using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;


namespace App3._6
{
    /// <summary>
    /// Interaction logic for Window1.xaml
    /// </summary>

    public partial class Window1 : System.Windows.Window
    {
        public Window1()
        {
            InitializeComponent();

            Image image = new Image();
            Uri imageUri = new Uri("Images/warning.bmp", UriKind.Relative);
            BitmapImage bmpImage = new BitmapImage(imageUri);
            image.Width = 16;
            image.Height = 16;
            image.Source = bmpImage;

            MenuItem menuItem1 = new MenuItem();
            menuItem1.Header = "menuItem1";
            menuItem1.Icon = image;

            MenuItem menuItem2 = new MenuItem();
            menuItem2.Header = "menuItem2";
            menuItem2.IsCheckable = true;
            MenuItem buttonItem = new MenuItem();
            Button button = new Button();
            buttonItem.Header = button;
            menuItem2.Items.Add(buttonItem);

            Menu menu = new Menu();
            menu.Items.Add(menuItem1);
            menu.Items.Add(new Separator());
            menu.Items.Add(menuItem2);

            stackPanel.Children.Add(menu);
        }
    }
}